<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/blog/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/blog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/blog/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/blog/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT" />










<meta property="og:type" content="website">
<meta property="og:title" content="smallmuou&#39;s blog">
<meta property="og:url" content="http://smallmuou.gitee.io/blog/page/8/index.html">
<meta property="og:site_name" content="smallmuou&#39;s blog">
<meta property="og:locale" content="zh-Hans">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="smallmuou&#39;s blog">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/blog/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://smallmuou.gitee.io/blog/page/8/"/>





  <title>smallmuou's blog</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left 
  page-home">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/blog/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">smallmuou's blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"><a href="https://github.com/smallmuou">https://github.com/smallmuou</a></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/blog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/blog/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/blog/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/blog/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            
  <section id="posts" class="posts-expand">
    
      

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://smallmuou.gitee.io/blog/blog/2017/06/20/2017-06-20-邮箱配置错误排查/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="smallmuou">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="smallmuou's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/blog/2017/06/20/2017-06-20-邮箱配置错误排查/" itemprop="url">邮箱配置错误排查</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-06-20T00:00:00+08:00">
                2017-06-20
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/技巧/" itemprop="url" rel="index">
                    <span itemprop="name">技巧</span>
                  </a>
                </span>

                
                
              
            </span>
          

          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>最近电脑重装系统，于是需要重新配置邮箱，在配置SMTP服务器是Foxmail老提示<code>SMTP Server：Email address or password error</code>，尝试了无数个可能的密码，还是无效。想起了命令行可以测试SMTP，于是命令行下直接执行，发现是错误次数太多<code>535 Error: too many incorrect passwords</code>，坑啊，竟然误导性提示</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">smou:~ $ telnet mail.star-net.cn 25</span><br><span class="line">Trying 110.90.119.100...</span><br><span class="line">Connected to mail.star-net.cn.</span><br><span class="line">Escape character is &apos;^]&apos;.</span><br><span class="line">220 star-net.cn Anti-spam GT for Coremail System (star-net[20170508])</span><br><span class="line">helo XXXXXXXX</span><br><span class="line">250 OK</span><br><span class="line">auth login</span><br><span class="line">334 dXNlcm5hbWU6</span><br><span class="line">输入用户名的base64编码</span><br><span class="line">334 UGFzc3dvcmQ6</span><br><span class="line">输入密码的base64编码</span><br><span class="line">535 Error: too many incorrect passwords</span><br></pre></td></tr></table></figure>
<p>而如果是密码错误，则会提示<code>535 Error: authentication failed</code></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">smou:~ $ telnet mail.star-net.cn 25</span><br><span class="line">Trying 110.90.119.100...</span><br><span class="line">Connected to mail.star-net.cn.</span><br><span class="line">Escape character is &apos;^]&apos;.</span><br><span class="line">220 star-net.cn Anti-spam GT for Coremail System (star-net[20170508])</span><br><span class="line">helo XXXXXXXX</span><br><span class="line">250 OK</span><br><span class="line">auth login</span><br><span class="line">334 dXNlcm5hbWU6</span><br><span class="line">输入用户名的base64编码</span><br><span class="line">334 UGFzc3dvcmQ6</span><br><span class="line">输入密码的base64编码</span><br><span class="line">535 Error: authentication failed</span><br></pre></td></tr></table></figure>
<p>于是只能等明天再次登录试一下。</p>
<p>所以，Coding不可乱提示，否则得坑无数人。</p>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://smallmuou.gitee.io/blog/blog/2017/06/15/2017-06-15-SVN服务迁移/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="smallmuou">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="smallmuou's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/blog/2017/06/15/2017-06-15-SVN服务迁移/" itemprop="url">SVN服务迁移</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-06-15T00:00:00+08:00">
                2017-06-15
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/版本管理/" itemprop="url" rel="index">
                    <span itemprop="name">版本管理</span>
                  </a>
                </span>

                
                
              
            </span>
          

          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>近期公司SVN服务器迁移，需要从Windows切到Linux，主要出于Windows版权问题；下面主要讲述下迁移过程</p>
<h3 id="步骤一：准备数据"><a href="#步骤一：准备数据" class="headerlink" title="步骤一：准备数据"></a>步骤一：准备数据</h3><p>将原Windows下的svn目录拷贝到Linux，目录结构如下：</p>
<pre>
├── htpasswd
├── authz
├── ...
</pre>

<h3 id="步骤二：安装Linux下的svn服务"><a href="#步骤二：安装Linux下的svn服务" class="headerlink" title="步骤二：安装Linux下的svn服务"></a>步骤二：安装Linux下的svn服务</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum -y install subversion</span><br></pre></td></tr></table></figure>
<p>PS：可以使用<code>svnversion --version</code>查看是否安装成功</p>
<h3 id="步骤三：配置用户及密码passwd"><a href="#步骤三：配置用户及密码passwd" class="headerlink" title="步骤三：配置用户及密码passwd"></a>步骤三：配置用户及密码passwd</h3><p>由于Windows采用htpasswd进行用户加密，因此用户是无法完成迁移，需要重新配置，在svn根目录下新建passwd文件，格式如下</p>
<pre>
[users]
test=test
...
</pre>
PS：原先用户信息是存放在htpasswd文件下，其中密码是md5加密的

PS：注意在添加完用户后，需要重启服务来生效用户

### 步骤四：配置组及项目权限authz
可以通过编辑svn根目录下的authz来，如配置某个项目允许哪些人访问，需要注意的是路径是相对svnserve指定的路径`svnserve -r /home/svn`

<pre>
[iHome:/]
test=rw
test=r
...
</pre>
PS: 该文件可以直接迁移过来

### 步骤五：新建配置svnserve.conf信息
在svn根目录下新建svnserve.conf文件，内容如下
<pre>
[general]
anon-access = none #此处需要设成none，否则会出现`want to go offline`的错误
auth-access = write
password-db = passwd # 设置用户密码文件路径，路径是相对于svnserve.conf，也可以使用绝对路径
authz-db = authz # 用户分组配置文件路径，路径是相对于svnserve.conf，，也可以使用绝对路径

[sasl]
</pre>
PS：svnserve.conf在每个工程下conf也有一份，若`svnserve`不指定config-file，则使用工程内部的svnserve.conf

PS：每行前面不可留有空格，否则会报`Option expected`错误

### 步骤六：配置系统服务

vim /etc/init.d/svnserve

添加自定义配置信息

<pre>
...
OPTIONS=-r /home/svn --config-file /home/svn/svnserve.conf
...
</pre>

<h3 id="步骤七：配置开机自启动"><a href="#步骤七：配置开机自启动" class="headerlink" title="步骤七：配置开机自启动"></a>步骤七：配置开机自启动</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">chkconfig --level 345 svnserve on</span><br></pre></td></tr></table></figure>
<h3 id="步骤八：启动服务"><a href="#步骤八：启动服务" class="headerlink" title="步骤八：启动服务"></a>步骤八：启动服务</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">service svnserve restart</span><br></pre></td></tr></table></figure>
<h3 id="步骤九：测试"><a href="#步骤九：测试" class="headerlink" title="步骤九：测试"></a>步骤九：测试</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[root@git svn]# svn ls svn://192.168.61.223/iHome</span><br><span class="line">branches/</span><br><span class="line">tags/</span><br><span class="line">trunk/</span><br></pre></td></tr></table></figure>
<p>PS: 此过程可能需要输入用户名及密码</p>
<p>以上是迁移的全过程，其中遇到不少坑，比如密码无法迁移、提交日志无法显示、全局配置svnserve.conf、Option expected、authz工程路径、防火墙；另外<code>svnserve --log-file</code>可以指定log文件,方便调试</p>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://smallmuou.gitee.io/blog/blog/2017/05/26/2017-05-26-云服务器sshd安全配置/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="smallmuou">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="smallmuou's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/blog/2017/05/26/2017-05-26-云服务器sshd安全配置/" itemprop="url">云服务器sshd安全配置</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-05-26T00:00:00+08:00">
                2017-05-26
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/运维/" itemprop="url" rel="index">
                    <span itemprop="name">运维</span>
                  </a>
                </span>

                
                
              
            </span>
          

          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>最近频繁收到公司购买的阿里或者腾讯云服务器被攻陷的信息，hacker在里面运行些肉鸡程序，经常占用系统大量资源，导致正常服务无法运行，甚至多次还被阿里和腾讯隔离，非常痛苦，于是去了解下关于sshd的安全配置，并实践了下发现很有用，这里分享下。</p>
<p>关于sshd服务，大家应该比较清楚，是登录云服务器的主要形式。而增加sshd安全有如下形式：</p>
<ol>
<li>使用长密码及复杂密码</li>
<li>修改sshd默认端口</li>
<li>关闭密码登录，启用密钥登录</li>
</ol>
<p>对于方式1和方式2，只是稍微增加了破解的时间，无法从根本解决。只有采用方式3才能保证。如下是具体步骤：</p>
<ul>
<li><p>步骤1. 客户端：利用ssh-keygen生成私钥id_rsa和公钥id_rsa.pub</p>
  <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh-keygen</span><br></pre></td></tr></table></figure>
</li>
</ul>
<p>PS: 在HOME目录的.ssh会产生2个文件id_rsa和id_rsa.pub</p>
<ul>
<li>步骤2. 服务端：创建HOME目录下.ssh</li>
<li><p>步骤3. 拷贝客户端公钥id_rsa.pub内容到服务器.ssh/authorized_keys下也可以利用ssh-copy-id进行操作</p>
  <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh-copy-id user@domain</span><br></pre></td></tr></table></figure>
</li>
</ul>
<p>PS：注意authorized_keys权限是644，否则无效</p>
<ul>
<li><p>步骤4. 客户端验证是否可以用密钥登录</p>
  <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh -i ~/.ssh/id_rsa user@domain</span><br></pre></td></tr></table></figure>
</li>
<li><p>步骤5. 服务端：关闭密码认证<br>sudo vim /etc/ssh/sshd_conf</p>
  <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">PasswordAuthentication no</span><br></pre></td></tr></table></figure>
</li>
<li><p>步骤6. 服务端：重启sshd服务</p>
  <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo service sshd restart</span><br></pre></td></tr></table></figure></li>
</ul>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://smallmuou.gitee.io/blog/blog/2017/05/22/2017-05-22-利用CGI快速构建HTTP API服务/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="smallmuou">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="smallmuou's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/blog/2017/05/22/2017-05-22-利用CGI快速构建HTTP API服务/" itemprop="url">利用CGI快速构建HTTP API服务</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-05-22T00:00:00+08:00">
                2017-05-22
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/后端/" itemprop="url" rel="index">
                    <span itemprop="name">后端</span>
                  </a>
                </span>

                
                
              
            </span>
          

          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>为了保证跨平台访问，最好的方式就是通过HTTP API方式，而HTTP API框架很多，有web.py、flask，但缺乏灵活性，只能用某种特定语言编写；而CGI则是语言无关，利用stdin、stdout进行数据传输，那么如何构建.</p>
<h3 id="1-安装Apache2"><a href="#1-安装Apache2" class="headerlink" title="1. 安装Apache2"></a>1. 安装Apache2</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get install apache2</span><br></pre></td></tr></table></figure>
<h3 id="2-开启CGI"><a href="#2-开启CGI" class="headerlink" title="2. 开启CGI"></a>2. 开启CGI</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">sudo ln -s /etc/apache2/mods-available/cgi.load /etc/apache2/mods-enabled/cgi.load</span><br><span class="line">sudo ln -s /etc/apache2/conf-available/serve-cgi-bin.conf /etc/apache2/conf-enabled/serve-cgi-bin.conf</span><br><span class="line"></span><br><span class="line">sudo service apache2 restart</span><br></pre></td></tr></table></figure>
<h3 id="3-编写CGI"><a href="#3-编写CGI" class="headerlink" title="3. 编写CGI"></a>3. 编写CGI</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">sudo vim /usr/lib/cgi-bin/hello</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">#!/bin/bash</span><br><span class="line">echo &apos;&apos;   # 需要输出空行，标识HTTP RESPONSE 头结束</span><br><span class="line">echo hello cgi</span><br></pre></td></tr></table></figure>
<p>增加可可执行权限<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo chmod +x hello</span><br></pre></td></tr></table></figure></p>
<h3 id="4-访问"><a href="#4-访问" class="headerlink" title="4. 访问"></a>4. 访问</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">osmc@osmc:/usr/lib/cgi-bin$ curl http://192.168.0.102/cgi-bin/hello</span><br><span class="line">hello cgi</span><br></pre></td></tr></table></figure>
<p>到此HTTP API框架已构建完成，你可以利用任意语言编写CGI脚本</p>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://smallmuou.gitee.io/blog/blog/2017/04/20/2017-04-20-Unix无法执行bash_profile/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="smallmuou">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="smallmuou's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/blog/2017/04/20/2017-04-20-Unix无法执行bash_profile/" itemprop="url">Unix无法执行bash_profile</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-04-20T00:00:00+08:00">
                2017-04-20
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/运维/" itemprop="url" rel="index">
                    <span itemprop="name">运维</span>
                  </a>
                </span>

                
                
              
            </span>
          

          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>一些理所当然的事，一旦出错，我们就如同热锅上的蚂蚁，到处乱窜，没有任何方向，因为在我们的脑海里，这是再熟悉不过的，是不可能发生的。就如同前些时间遇到的问题：MacOSX上Terminal登录的时候不执行bash_profile。遇到这种情况，必须clear自己，清空固化在脑中的「所谓常识」，理清原理。</p>
<p>其实针对这个问题，我们忽略了只有bash才会执行bash_profile，而其实shell出来bash，还有dash、sh、zsh等等，它们各自执行自己的profile.</p>
<p>最后来点不重要的: MacOSX下如何修改shell ?</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">chsh -s /bin/bash</span><br></pre></td></tr></table></figure>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://smallmuou.gitee.io/blog/blog/2017/04/14/2017-04-14-教你读懂路由表/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="smallmuou">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="smallmuou's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/blog/2017/04/14/2017-04-14-教你读懂路由表/" itemprop="url">教你读懂路由表</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-04-14T00:00:00+08:00">
                2017-04-14
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/运维/" itemprop="url" rel="index">
                    <span itemprop="name">运维</span>
                  </a>
                </span>

                
                
              
            </span>
          

          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>很多网络问题都跟路由有关，那么首先必须学会看懂路由表，本文将讲述如何读懂路由及如何决策.</p>
<p>在命令行下输入<code>route -n</code> 或 <code>netstat -rn</code>，就可以打印本机的路由表，我的如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">Destination     Gateway         Genmask         Flags Metric Ref    Use Iface</span><br><span class="line">192.168.161.0   192.168.161.1   255.255.255.0   UG    0      0        0 em1</span><br><span class="line">192.168.161.0   0.0.0.0         255.255.255.0   U     0      0        0 em1</span><br><span class="line">192.168.61.0    0.0.0.0         255.255.255.0   U     0      0        0 em2</span><br><span class="line">169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 em1</span><br><span class="line">169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 em2</span><br><span class="line">192.168.0.0     192.168.61.1    255.255.0.0     UG    0      0        0 em2</span><br><span class="line">0.0.0.0         192.168.61.1    0.0.0.0         UG    0      0        0 em2</span><br><span class="line">0.0.0.0         192.168.161.1   0.0.0.0         UG    0      0        0 em1</span><br></pre></td></tr></table></figure>
<p>PS：我的电脑是双网卡，分别在192.168.61.0和192.168.161.0两个网段</p>
<h3 id="1-字段解释"><a href="#1-字段解释" class="headerlink" title="1.字段解释"></a>1.字段解释</h3><table>
<thead>
<tr>
<th style="text-align:left">字段名</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">Destination</td>
<td>目的网段，最长匹配192.168.161.0 &gt; 192.168.0.0 &gt; 0.0.0.0，0可匹配任意数值</td>
</tr>
<tr>
<td style="text-align:left">Gateway</td>
<td>所走网关，0.0.0.0表示无网关，即与本机IP同一网段，不需要经过网关（<strong>同一个局域网内2台主机通信不需要经过网关</strong>）</td>
</tr>
<tr>
<td style="text-align:left">Genmask</td>
<td>掩码</td>
</tr>
<tr>
<td style="text-align:left"><a href="http://www.thegeekstuff.com/2012/05/route-flags/?utm" target="_blank" rel="noopener">Flags</a></td>
<td>标志，U - Up表示有效<br>G - Gateway表示连接路由，若无这个字段表示直连目的地址<br>H - Host表示目标是具体主机，而不是网段</td>
</tr>
<tr>
<td style="text-align:left">Metric</td>
<td>待补充</td>
</tr>
<tr>
<td style="text-align:left">Ref</td>
<td>待补充</td>
</tr>
<tr>
<td style="text-align:left">Use</td>
<td>待补充</td>
</tr>
<tr>
<td style="text-align:left">Iface</td>
<td>网卡</td>
</tr>
</tbody>
</table>
<h3 id="2-路由匹配"><a href="#2-路由匹配" class="headerlink" title="2.路由匹配"></a>2.路由匹配</h3><p>路由表的作用就是指定下一级网关，那么根据路由表怎么确定下一级网关，这里就有一个匹配过程，匹配规则</p>
<p>*（1）优先级匹配（暂不讨论）</p>
<p>*（2）最长匹配</p>
<h3 id="3-实例讲述"><a href="#3-实例讲述" class="headerlink" title="3.实例讲述"></a>3.实例讲述</h3><p>还是针对上面的路由表，为了方便表述，加上条目号字段</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">No  Destination     Gateway         Genmask         Flags Metric Ref    Use Iface</span><br><span class="line">1	192.168.161.0   192.168.161.1   255.255.255.0   UG    0      0        0 em1</span><br><span class="line">2	192.168.161.0   0.0.0.0         255.255.255.0   U     0      0        0 em1</span><br><span class="line">3	192.168.61.0    0.0.0.0         255.255.255.0   U     0      0        0 em2</span><br><span class="line">4	169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 em1</span><br><span class="line">5	169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 em2</span><br><span class="line">6	192.168.0.0     192.168.61.1    255.255.0.0     UG    0      0        0 em2</span><br><span class="line">7	0.0.0.0         192.168.61.1    0.0.0.0         UG    0      0        0 em2</span><br><span class="line">8	0.0.0.0         192.168.161.1   0.0.0.0         UG    0      0        0 em1</span><br></pre></td></tr></table></figure>
<ul>
<li>192.168.61.35 - 匹配条目3，即不需要经过网关</li>
<li>192.168.60.150 - 匹配条目6，需要经过网关192.168.60.1</li>
<li><a href="http://www.baidu.com" target="_blank" rel="noopener">www.baidu.com</a> - 匹配条目7，这里需要说明下为何不匹配8？这是我实践的结果，后加的默认网关会在列表前面，即优先匹配。这个规则应该用于所有Destination一致的情况</li>
<li>192.168.161.113 - 匹配条目1，<strong>不是匹配条目2</strong></li>
</ul>
<h3 id="4-路由编辑"><a href="#4-路由编辑" class="headerlink" title="4. 路由编辑"></a>4. 路由编辑</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 添加默认网关</span></span><br><span class="line">route add default gw 192.168.1.1</span><br><span class="line"></span><br><span class="line"><span class="comment"># 删除默认网关</span></span><br><span class="line">route del default</span><br><span class="line"></span><br><span class="line"><span class="comment"># 添加本地路由</span></span><br><span class="line">route add -net 192.168.1.0 netmask 255.255.255.0 eth0</span><br><span class="line">route add -net 192.168.1.0/24 eth0</span><br><span class="line"></span><br><span class="line"><span class="comment"># 删除本地路由</span></span><br><span class="line">route del -net 192.168.1.0 netmask 255.255.255.0 eth0</span><br><span class="line">route del -net 192.168.1.0/24 eth0</span><br><span class="line"></span><br><span class="line"><span class="comment"># 清空所有路由</span></span><br><span class="line">ip route flush table main</span><br></pre></td></tr></table></figure>
<h3 id="5-总结"><a href="#5-总结" class="headerlink" title="5. 总结"></a>5. 总结</h3><ul>
<li>结论1： 一台局域网下的主机路由表至少需要包含一条本地路由，否则无法与路由网关通信，当添加默认网关，会提示”SIOCADDRT: Network is unreachable”。</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">No  Destination     Gateway         Genmask         Flags Metric Ref    Use Iface</span><br><span class="line">2   192.168.161.0   0.0.0.0         255.255.255.0   U     0      0        0 em1</span><br></pre></td></tr></table></figure>
<p>这样才能ping通网关（192.168.161.1）及外部ping通本机</p>
<ul>
<li>结论2： 一台局域网下的可访问Internet主机路由表至少需要包含两条路由，一条是本地路由，一条是默认网关</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">No  Destination     Gateway         Genmask         Flags Metric Ref    Use Iface</span><br><span class="line">2   192.168.161.0   0.0.0.0         255.255.255.0   U     0      0        0 em1</span><br><span class="line">7   0.0.0.0         192.168.61.1    0.0.0.0         UG    0      0        0 em2</span><br></pre></td></tr></table></figure>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://smallmuou.gitee.io/blog/blog/2017/04/12/2017-04-12-SHELL常用技巧/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="smallmuou">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="smallmuou's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/blog/2017/04/12/2017-04-12-SHELL常用技巧/" itemprop="url">SHELL常用技巧</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-04-12T00:00:00+08:00">
                2017-04-12
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/SHELL/" itemprop="url" rel="index">
                    <span itemprop="name">SHELL</span>
                  </a>
                </span>

                
                
              
            </span>
          

          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>真正喜欢SHELL还是从使用MacBook开始，MacOSX可谓是将SHELL与图形结合的淋漓尽致（Windows偏图形、Linux偏SHELL），使用到现在，差不多也有3年了，其中积累了很多有用的技巧，可以大大提升我的工作效率，现在我将这些罗列出来，当然这是一个长期的过程，毕竟有些可能会一时想不起来。</p>
<p>技巧|更新时间|命令|例子<br>|:–|:–|:–<br>URL编码|April 12, 2017|alias urlencode=’python -c “import sys, urllib as ul; print ul.quote_plus(sys.argv[1])”‘|urlencode 我们<br>URL解码|April 12, 2017|alias urldecode=’python -c “import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])”‘|urldecode %E6%88%91%E4%BB%AC<br>查看所连苹果设备UDID|April 12, 2017|alias udid=’system_profiler SPUSBDataType | sed -n  -e “/iPad/,/Extra/p” -e “/iPhone/,/Extra/p”‘|udid<br>查看公网IP|April 12, 2017|curl <a href="http://ip.cn/|curl" target="_blank" rel="noopener">http://ip.cn/|curl</a> <a href="http://ip.cn/" target="_blank" rel="noopener">http://ip.cn/</a><br>启动HTTP服务|April 12, 2017|python -m SimpleHTTPServer|python -m SimpleHTTPServer<br>生成二维码|April 12, 2017|qrencode|qrencode -t ANSI xxxx<br>测试网速|April 12, 2017|speedtest-cli|speedtest-cli<br>统计行数|April 12, 2017|wc -l|ls | wc -l<br>统计字符|April 12, 2017|wc -c|echo ‘hello’ | wc -c<br>计算文件夹大小|April 12, 2017|du -h -d 0 xxxx|du -h -d 0 ~<br>查看目录结构|April 12, 2017|tree|tree ~<br>ssh免密码登录|April 12, 2017|ssh-copy-id|ssh-copy-id <a href="mailto:root@192.168.0.100" target="_blank" rel="noopener">root@192.168.0.100</a><br>行首添加指定字符|April 12, 2017|sed ‘s/^/xxxx/g’|ls | sed ‘s/^/hello/g’<br>行尾添加指定字符|April 12, 2017|sed ‘s/$/xxxx/g’|ls | sed ‘s/$/hello/g’<br>执行远端命令|April 12, 2017|ssh <a href="mailto:root@192.168.0.100" target="_blank" rel="noopener">root@192.168.0.100</a> commands|ssh <a href="mailto:root@192.168.0.100" target="_blank" rel="noopener">root@192.168.0.100</a> ls<br>查看路由表|April 12, 2017|netstat -r|netstat -r<br>查看监听端口|April 12, 2017|netstat -ltp|netstat -ltp<br>图片转换|April 14, 2017|convert(安装imageMagick)|convert 1.png 1.jpg<br>查看图片信息（大小、格式）|April 14, 201710:52|identify（安装imageMagick）|imageMagick 1.png<br>统计相同行个数|ls| awk ‘{a[$1]++}END{for(i in a){print a[i], i}}’|</p>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://smallmuou.gitee.io/blog/blog/2017/04/11/2017-04-11-iOS后台实践/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="smallmuou">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="smallmuou's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/blog/2017/04/11/2017-04-11-iOS后台实践/" itemprop="url">iOS后台实践</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-04-11T00:00:00+08:00">
                2017-04-11
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/IOS/" itemprop="url" rel="index">
                    <span itemprop="name">IOS</span>
                  </a>
                </span>

                
                
              
            </span>
          

          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>一提到iOS后台机制，网上搜了下一大堆资料，众说纷纭，现结合<a href="https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html" target="_blank" rel="noopener">苹果官方文档</a>及自身实际对现阶段(iOS10)iOS后台技术做个梳理。APP应用状态分为激活、未激活、后台:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">typedef NS_ENUM(NSInteger, UIApplicationState) &#123;</span><br><span class="line">    UIApplicationStateActive, // 前台</span><br><span class="line">    UIApplicationStateInactive, //后台未在运行</span><br><span class="line">    UIApplicationStateBackground //后台运行</span><br><span class="line">&#125; NS_ENUM_AVAILABLE_IOS(4_0);</span><br></pre></td></tr></table></figure>
<p>本文要讨论就是UIApplicationStateBackground模式。Apple提供了以下三种方式：</p>
<ul>
<li>方式一：延长小段时间(beginBackgroundTaskWithName)</li>
<li>方式二：系统托管下载任务(NSURLSession)</li>
<li>方式三：特定类型APP（Audio、Location、VOIP、Bluetooth、Newsstand、External accessory、Background fetch、Remote notifications）</li>
</ul>
<h3 id="方式一：延长小段时间-beginBackgroundTaskWithName"><a href="#方式一：延长小段时间-beginBackgroundTaskWithName" class="headerlink" title="方式一：延长小段时间(beginBackgroundTaskWithName)"></a>方式一：延长小段时间(beginBackgroundTaskWithName)</h3><p>为了保证某些短任务能够顺序执行完成，iOS允许APP向系统申请一小段时间以供任务顺利完成，代码如下</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">- (void)applicationDidEnterBackground:(UIApplication *)application</span><br><span class="line">&#123;</span><br><span class="line">    bgTask = [application beginBackgroundTaskWithName:@&quot;MyTask&quot; expirationHandler:^&#123;</span><br><span class="line">    	//系统即将进入inactive</span><br><span class="line">        [application endBackgroundTask:bgTask];</span><br><span class="line">        bgTask = UIBackgroundTaskInvalid;</span><br><span class="line">    &#125;];</span><br><span class="line"> </span><br><span class="line">	//主动结束</span><br><span class="line">    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^&#123; </span><br><span class="line">        [application endBackgroundTask:bgTask];</span><br><span class="line">        bgTask = UIBackgroundTaskInvalid;</span><br><span class="line">    &#125;);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>PS：beginBackgroundTaskWithName向系统申请延长休眠时间，endBackgroundTask表示系统可以进入休眠</p>
<p>需要注意的是：查了网上其他文章，都说可以最长申请600s的时间，但实际测试只有179s左右（应该跟系统有关，iOS6是600s，iOS7以上是180s，我的系统是iOS 10.0.1），可以通过backgroundTimeRemaining查询（打印是179.988913s），但没有找到可以设置的地方。<strong>需要注意的是backgroundTimeRemaining只在进入后台是有效，前台的话会是一个很大的值</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">@property(nonatomic,readonly) NSTimeInterval backgroundTimeRemaining NS_AVAILABLE_IOS(4_0);</span><br></pre></td></tr></table></figure>
<h3 id="方式二：系统托管下载任务-NSURLSession"><a href="#方式二：系统托管下载任务-NSURLSession" class="headerlink" title="方式二：系统托管下载任务(NSURLSession)"></a>方式二：系统托管下载任务(NSURLSession)</h3><p>待补充</p>
<p>参考：</p>
<ul>
<li><a href="https://onevcat.com/2013/08/ios7-background-multitask/" target="_blank" rel="noopener">WWDC 2013 Session笔记 - iOS7中的多任务</a></li>
</ul>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://smallmuou.gitee.io/blog/blog/2017/04/07/2017-04-07-让树莓派播报实时天气/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="smallmuou">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="smallmuou's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/blog/2017/04/07/2017-04-07-让树莓派播报实时天气/" itemprop="url">让树莓派播报实时天气</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-04-07T00:00:00+08:00">
                2017-04-07
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/树莓派/" itemprop="url" rel="index">
                    <span itemprop="name">树莓派</span>
                  </a>
                </span>

                
                
              
            </span>
          

          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>最近一段时间天气总是多变，经常需要查手机，于是希望树莓派能够实时播报天气，这样可以让家里的老人小孩了解到天气变化。因为原来有弄过一些功能，比如文字转语音、播放语音等，因此过程相对简单，具体如下</p>
<h3 id="步骤一-获取天气"><a href="#步骤一-获取天气" class="headerlink" title="步骤一. 获取天气"></a>步骤一. 获取天气</h3><p>提供天气预报的API还是挺多的，这里选择<a href="https://www.heweather.com/" target="_blank" rel="noopener">和风天气</a>，有免费版，而且文档还比较完善，提供了实时天气、生活指数、未来3天预报等；使用步骤也比较简单，注册、激活、获取key；这里只用到了实时天气及生活指数</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"># 获取实时天气</span><br><span class="line">whether=`curl -s &apos;https://free-api.heweather.com/v5/now?city=城市名&amp;key=你的key&apos;|jshon -e HeWeather5 -e 0 -e now`</span><br><span class="line">cond=`echo $whether|jshon -e cond -e text`</span><br><span class="line"># 获取温度</span><br><span class="line">tmp=`echo $whether|jshon -e tmp`</span><br><span class="line"># 获取舒适度指数</span><br><span class="line">comf=`curl -s &apos;https://free-api.heweather.com/v5/suggestion?city=城市名&amp;key=你的key&apos;|jshon -e HeWeather5 -e 0 -e suggestion -e comf -e txt`</span><br></pre></td></tr></table></figure>
<p>PS：城市名可以中文、拼音，jshon是json解析工具</p>
<h3 id="步骤二-拼接字符串"><a href="#步骤二-拼接字符串" class="headerlink" title="步骤二. 拼接字符串"></a>步骤二. 拼接字符串</h3><p>为了比较正式，我添加了日期，具体如下</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">week=`date +星期%w|sed &apos;y/1234567/一二三四五六天/&apos;`</span><br><span class="line">echo &quot;今天是`date +%Y年%-m月%-d号`$week $cond $tmp摄氏度 $comf&quot;</span><br></pre></td></tr></table></figure>
<p>最终出来的结果是：<code>今天是2017年4月7号星期五 晴 22摄氏度 白天有雨，从而使空气湿度加大，会使人们感觉有点儿闷热，但早晚的天气很凉爽、舒适。</code></p>
<h3 id="步骤三-文字转成语音"><a href="#步骤三-文字转成语音" class="headerlink" title="步骤三. 文字转成语音"></a>步骤三. 文字转成语音</h3><p>利用百度语音，将文字转成语音，并利用音频播放软件进行播放</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/user/local/bin/pi whether fuzhou|/user/local/bin/pi say</span><br></pre></td></tr></table></figure>
<p>PS: pi say 可以将文字转成语音并播放</p>
<h3 id="步骤四-定点播报"><a href="#步骤四-定点播报" class="headerlink" title="步骤四. 定点播报"></a>步骤四. 定点播报</h3><p>可以利用cron设定每天7点进行播报</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">* 7 * * * /user/local/bin/pi whether fuzhou|/user/local/bin/pi say</span><br></pre></td></tr></table></figure>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://smallmuou.gitee.io/blog/blog/2017/04/06/2017-04-06-HTTPS协议的由来/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="smallmuou">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="smallmuou's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/blog/2017/04/06/2017-04-06-HTTPS协议的由来/" itemprop="url">HTTPS协议的由来</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-04-06T00:00:00+08:00">
                2017-04-06
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/后端/" itemprop="url" rel="index">
                    <span itemprop="name">后端</span>
                  </a>
                </span>

                
                
              
            </span>
          

          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>一提到HTTPS，第一印象就是安全，可是具体怎么安全，为什么安全，可能就说不上来，我不断查阅了资料，对HTTPS也有了一定的理解，现在用一个比较恰当的故事来表示HTTPS的由来.</p>
<h3 id="0-背景"><a href="#0-背景" class="headerlink" title="0. 背景"></a>0. 背景</h3><p>A、B、C是同班同学，A和B同时喜欢C，A、B、C坐位依次。大家可以把A理解为客户端、B理解为中间网络（网络设备、运营商、中间服务器），C理解为服务器</p>
<h3 id="1-阶段1（HTTP）"><a href="#1-阶段1（HTTP）" class="headerlink" title="1. 阶段1（HTTP）"></a>1. 阶段1（HTTP）</h3><p>有一天A发明了递纸条的方法，于是A写好纸条，让B帮忙交给C，C收到后，同样方式回复给A</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"> ---           ---           ---</span><br><span class="line">|   |   HTTP  |   |   HTTP  |   |</span><br><span class="line">|   |--------&gt;|   |--------&gt;|   |</span><br><span class="line">| A |   HTTP  | B |   HTTP  | C |</span><br><span class="line">|   |&lt;--------|   |&lt;--------|   |</span><br><span class="line">|   |         |   |         |   |</span><br><span class="line"> ---           ---           ---</span><br></pre></td></tr></table></figure>
<p>问题1：B既然也喜欢C，而B就可以看到A与C写的字条，于是就偷偷篡改里面的内容，于是A与C就无法正常进行通讯</p>
<h3 id="2-阶段2（对称加密）"><a href="#2-阶段2（对称加密）" class="headerlink" title="2. 阶段2（对称加密）"></a>2. 阶段2（对称加密）</h3><p>A在想，竟然B可以看到纸条内容，于是就想到通过加密把纸条内容比为密文，这样大家就看不到里面的内容，可是前提，需要把密码告诉对方，这样对方才能解密。</p>
<p>问题2：如何传递密码呢？因为所有数据都得经过B，如何把这个密码传递给C，直接传递，这样B也就知道了如何解密，这样加密就没有任何意义。</p>
<h3 id="3-阶段3（非对称加密，不受信任访问）"><a href="#3-阶段3（非对称加密，不受信任访问）" class="headerlink" title="3. 阶段3（非对称加密，不受信任访问）"></a>3. 阶段3（非对称加密，不受信任访问）</h3><p>上一阶段提到了如何传递密码，A经过苦思幂想，终于发明了非对称加密（公钥、私钥），即用公钥加密的内容，可以用私钥解密。A、C分别拥有自己的公私钥，于是正常通信过程就如下</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"> ---           ---           ---</span><br><span class="line">|   |----1---&gt;|   |----2---&gt;|   |</span><br><span class="line">|   |&lt;---4----|   |&lt;---3----|   |</span><br><span class="line">| A |----5---&gt;| B |----6---&gt;| C |</span><br><span class="line">|   |&lt;---8----|   |&lt;---7----|   |</span><br><span class="line">|   |&lt;---10--&gt;|   |&lt;---11--&gt;|   |</span><br><span class="line"> ---           ---           ---</span><br><span class="line"></span><br><span class="line">1 2 - 获取C公钥（并发送对称加密算法族）</span><br><span class="line">3 4 - 返回C公钥（返回其中一个加密算法）</span><br><span class="line">5 6 - 发送利用C公钥加密后的A公钥及对称密钥A</span><br><span class="line">7 8 - 发送利用A公钥加密后的对称密钥C</span><br><span class="line">10  - A利用对称密钥C收数据，利用对称密钥A发送数据</span><br><span class="line">11  - C利用对称密钥A收数据，利用对称密钥C发送数据</span><br></pre></td></tr></table></figure>
<p>PS: 这里插入个问题：<code>为何数据不用非对称加密，这样就不用传递对称密钥？</code> 这是因为对称加密效率要比非对称高，因此采用对称加密，可以保证效率，否则HTTPS性能堪忧.</p>
<p>问题3：这样A与C又可以正常通信，直到有天B也发现了公私钥，于是B也生成了公私钥，并采用了如下方式进行信息窃取</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"> ---           ---           ---</span><br><span class="line">|   |----1---&gt;|   |----2---&gt;|   |</span><br><span class="line">|   |&lt;---4----|   |&lt;---3----|   |</span><br><span class="line">| A |----5---&gt;| B |----6---&gt;| C |</span><br><span class="line">|   |&lt;---8----|   |&lt;---7----|   |</span><br><span class="line">|   |&lt;---10--&gt;|   |&lt;---11--&gt;|   |</span><br><span class="line"> ---           ---           ---</span><br><span class="line"></span><br><span class="line">1 2 - 获取C公钥</span><br><span class="line">3   - 返回C公钥 </span><br><span class="line">4   - 返回B公钥</span><br><span class="line">5   - 发送利用B公钥加密后的A公钥及对称密钥A</span><br><span class="line">6   - 发送利用C公钥加密后的B公钥及对称密钥B</span><br><span class="line">7   - 发送利用B公钥加密后的对称密钥C</span><br><span class="line">8   - 发送利用A公钥加密后的对称密钥B</span><br><span class="line">10  - A利用对称密钥B收数据，利用对称密钥A发送数据</span><br><span class="line">11  - C利用对称密钥B收数据，利用对称密钥C发送数据</span><br></pre></td></tr></table></figure>
<p>PS: 于是A与C又无法正常通信了</p>
<h3 id="4-阶段4（数字证书）"><a href="#4-阶段4（数字证书）" class="headerlink" title="4. 阶段4（数字证书）"></a>4. 阶段4（数字证书）</h3><p>A又经过一夜的苦思幂想，想到了可以使用数字证书方案（所谓数字证书，就相当于身份证，跟人是一一对应的，无法伪造），于是A让C到CA（Certificate Authority）中心申请盖章，因此C就拥有一个由CA盖章的公钥，这样即使B也去申请，但CA认为身份不合法，不给批。这样A在获取到C公钥后会通过CA校验这个公钥是否属于C，因此B就无法伪造，于是B就无法获取到对称密钥，即最终A、C就可以安全地通信。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"> ---           ---           ---</span><br><span class="line">|   |----1---&gt;|   |----2---&gt;|   |</span><br><span class="line">|   |&lt;---4----|   |&lt;---3----|   |</span><br><span class="line">| A 9----5---&gt;| B |----6---&gt;| C |</span><br><span class="line">|   |&lt;---8----|   |&lt;---7----|   |</span><br><span class="line">|   |&lt;---10--&gt;|   |&lt;---11--&gt;|   |</span><br><span class="line"> ---           ---           ---</span><br><span class="line"></span><br><span class="line">1 2 - 获取C公钥</span><br><span class="line">3 4 - 返回C公钥</span><br><span class="line">9   - A对C公钥进行校验，当确认是C的公钥，则继续会话，否则结束</span><br><span class="line">5 6 - 发送利用C公钥加密后的A公钥及对称密钥A</span><br><span class="line">7 8 - 发送利用A公钥加密后的对称密钥C</span><br><span class="line">10  - A利用对称密钥C收数据，利用对称密钥A发送数据</span><br><span class="line">11  - C利用对称密钥A收数据，利用对称密钥C发送数据</span><br></pre></td></tr></table></figure>
<p>PS: 与阶段3的区别是，多了步骤9，客户端需要对C公钥进行校验。</p>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
  </section>

  
  <nav class="pagination">
    <a class="extend prev" rel="prev" href="/blog/page/7/"><i class="fa fa-angle-left"></i></a><a class="page-number" href="/blog/">1</a><span class="space">&hellip;</span><a class="page-number" href="/blog/page/7/">7</a><span class="page-number current">8</span><a class="page-number" href="/blog/page/9/">9</a><span class="space">&hellip;</span><a class="page-number" href="/blog/page/20/">20</a><a class="extend next" rel="next" href="/blog/page/9/"><i class="fa fa-angle-right"></i></a>
  </nav>



          </div>
          


          

        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      

      <section class="site-overview-wrap sidebar-panel sidebar-panel-active">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">smallmuou</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/blog/archives/">
              
                  <span class="site-state-item-count">197</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/blog/categories/index.html">
                  <span class="site-state-item-count">12</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/smallmuou" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-globe"></i>GitHub</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">smallmuou</span>

  
</div>

    <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

    <span id="busuanzi_container_site_pv">总访问量<span id="busuanzi_value_site_pv"></span>次</span>
    <span class="post-meta-divider">|</span>



  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/blog/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/blog/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/motion.js?v=5.1.4"></script>



  
  

  

  


  <script type="text/javascript" src="/blog/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
